<template>
  <div>
    <van-search
      v-model="searchValue"
      placeholder="请输入要搜索的公司名"
      shape="round"
      @search="onSearch"
    />
    <div class="company-list" v-for="(item,index) in list" :key="index">
      <div class="company-item" @click="goToLink(item.company)">
        <div class="left">{{item.company}}</div>
        <div class="center">|</div>
        <div class="right">{{item.park}}</div>
      </div>
      <div class="data-from data-from1" v-if="$route.params.hasTag!=0">{{$route.params.type}}</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      searchValue:'',
      list: [
        {
          company: "润湾投资",
          park: "181社区",
        },
        {
          company: "华立",
          park: "181社区",
        },
        {
          company: "志远科技",
          park: "181社区",
        },
      ],
    };
  },
  methods: {
    goToLink(name) {
      if (this.$route.params.hasTag == 0) {
        this.$router.push("/companyInfo");
      } else {
        this.$router.push(`/questionDeal/${name}/deal`);
      }
    },
    onSearch(){
      console.log('搜索',this.searchValue)
    }
  },
};
</script>

<style scoped lang="less">
.company-list {
  position: relative;
  margin: 0 10px;
}
.company-item {
  background: rgba(50, 164, 224, 0.8);
  border-radius: 10px;
  height: 50px;
  color: #fff;
  margin-bottom: 15px;
}
.company-item div {
  float: left;
  line-height: 50px;
}
.left {
  text-align: right;
  width: 48%;
}
.center {
  text-align: center;
  width: 4%;
}
.right {
  text-align: left;
  width: 48%;
}
.data-from {
  font-size: 12px;
  position: absolute;
  padding: 5px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 5px;
  background: #71bda6;
  color: #fff;
}
.data-from1 {
  background: rgba(0, 194, 151, 0.8);
}
</style>